package net.niufei.study.cpatterns.activeobject;

public class DisplayThread extends Thread {

	private final ActiveObject activeObject;

	public DisplayThread(String name, ActiveObject activeObject) {
		super(name);
		this.activeObject = activeObject;
	}

	
	@Override
	public void run() {
		while(true) {
			String string = Thread.currentThread().getName();
			activeObject.displayString(string);
			try {
				Thread.sleep(500L);
			} catch (InterruptedException e) {}
		}
	}

	

}
